<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无障碍云后台管理系统</title>
<script type="text/javascript" src="/js/jquery-easyui-1.4.5/jquery.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="/js/jquery-easyui-1.4.5/jquery.easyui.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="/js/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4.5/themes/default/easyui.css" charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4.5/themes/icon.css" charset="UTF-8" />
<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
	function exportComplaint() {
		var path = '${contextPath}/admin/exportComplaint';
		var checkNum = $("input[name='str']:checked").length;
		if (checkNum < 1) {
			alert("请至少选择一项!");
			return;
		}
		var form = document.getElementById("Form1");		
		form.action = path;
		form.submit();
	}
	
	
	function deleteComplaint() {
		var path = '${contextPath}/admin/deleteComplaint';
		var checkNum = $("input[name='str']:checked").length;
		if (checkNum < 1) {
			alert("请至少选择一项!");
			return;
		}
		if (confirm("确认删除吗?") == true) {
			var form = document.getElementById("Form1");
			form.action = path;
			form.submit();
			return;
		} else {
			return;
		}
	}
</script>

</head>
<body>
	<form id="Form1" method="post" action="">
		<table id="tt" title="查询投诉登记单" class="easyui-datagrid" toolbar="#toolbar">
			<thead>
				<tr>
					<th field="str" checkbox="true"></th>
					<th field="编号" width="190">编号</th>
					<th field="消费者姓名" width="80">消费者姓名</th>
					<th field="消费者联系电话" width="120" align="left">消费者联系电话</th>
					<th field="被投诉方名称" width="200" align="left">被投诉方名称</th>
					<th field="被投诉方地址" width="270">被投诉方地址</th>
					<th field="商品或服务名称" width="200" align="left">商品或服务名称</th>
					<th field="购买或接收服务时间" width="120" align="left">购买或接收服务时间</th>
					<th field="事件发生时间" width="80" align="left">事件发生时间</th>
					<th field="操作" width="120" align="left">操作</th>
				</tr>
			</thead>
				<c:forEach items="${result }" var="res">
					<tr>
						<td>${res.id }</td>
						<td>${res.id }</td>
						<td>${res.name }</td>
						<td>${res.phone }</td>
						<td>${res.designation }</td>
						<td>${res.local }</td>
						<td>${res.goods_name }</td>
						<td>${res.year }-${res.month }-${res.day }</td>
						<td>${res.year2 }-${res.month2 }-${res.day2 }</td>
						<td>
							<a href="${contextPath}/admin/queryComplaintById?id=${res.id }">查看</a> 
							<a href="${contextPath}/admin/exportComplaintById?id=${res.id }">导出</a> 
							<a href="${contextPath}/admin/deleteComplaintById?id=${res.id }" onclick="javascript:if (confirm('确定删除吗？')) { return true;}else{return false;};"> 删除</a>
						</td>
					</tr>
				</c:forEach>
		</table>
		<div id="toolbar">
			<a href="javascript:exportComplaint();" class="easyui-linkbutton" iconCls="icon-print" plain="true" >导出</a>
			<a href="javascript:deleteComplaint();" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" >删除</a>
			<a href="${contextPath}/login" class="easyui-linkbutton" iconCls="icon-undo" plain="true" >退出</a>
		</div>
	</form>
</body>
</html>